From 68546793d3ead9fef78f4b6670b4bee92ae99bc8 Mon Sep 17 00:00:00 2001
From: Ye Holmes <yeholmes@outlook.com>
Date: Wed, 17 Feb 2021 19:26:52 +0800
Subject: [PATCH] fix-openpgm-linking-for-zeromq

---
 CMakeLists.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -793,7 +793,7 @@ else()
     # message(FATAL_ERROR "WITH_OPENPGM not implemented")
 
     if(NOT OPENPGM_PKGCONFIG_NAME)
-      set(OPENPGM_PKGCONFIG_NAME "openpgm-5.2")
+      set(OPENPGM_PKGCONFIG_NAME "openpgm-5.3")
     endif()
 
     set(OPENPGM_PKGCONFIG_NAME
@@ -804,6 +804,8 @@ else()
 
     if(OPENPGM_FOUND)
       message(STATUS ${OPENPGM_PKGCONFIG_NAME}" found")
+      find_library(OPENPGM_LIBRARIES NAMES libpgm pgm)
+      set(pkg_config_libs_private "${pkg_config_libs_private} -lpgm")
       set(pkg_config_names_private "${pkg_config_names_private} ${OPENPGM_PKGCONFIG_NAME}")
     else()
       message(
@@ -1447,6 +1449,10 @@ if(BUILD_SHARED)
     endif()
   endif()
 
+  if(OPENPGM_FOUND)
+   target_link_libraries(libzmq ${OPENPGM_LIBRARIES})
+  endif()
+
   if(HAVE_WS2_32)
     target_link_libraries(libzmq ws2_32)
   elseif(HAVE_WS2)
